<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<#include "lib/lib.html" />
<title>添加赞助商接口信息</title>
</head>
<body>
<div class="pd-30">
	<form action="${basePath}/sysCom/addComInterfaceInfo.do" method="post" class="form form-horizontal" id="form-sydDic-add">
	  <input type="hidden" name="sponsorName" id="sponsorName"/>
	    <div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>赞助商列表：</label>
			<div class="formControls col-5"> <span class="select-box" >
				<select class="select" id="sponsorId" name="sponsorId"  datatype="*" nullmsg="请选择！" onchange="popValue(this.value)">
				<option value="" ></option>
					<#if bussSponsorInfoList??&&bussSponsorInfoList?size gt 0>
					<#list bussSponsorInfoList as ll >
						<option value="${ll.id!}" >${ll.salesManName!}</option>
					</#list>
					</#if>
				</select>
			</span> 
			</div>
			<div class="col-3"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>赞助商code:</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="" placeholder="" id="sponsorCode" name="sponsorCode" datatype="*2-70" nullmsg="赞助商code不能为空">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>赞助商token:</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="" placeholder="" id="token" name="token" datatype="*2-70" nullmsg="赞助商token不能为空">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>赞助商理财URL:</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="" placeholder="" id="url" name="url"  datatype="*2-200" nullmsg="赞助商理财URL不能为空">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-3"><span class="c-red">*</span>赞助商任务URL:</label>
			<div class="formControls col-5">
				<input type="text" class="input-text" value="" placeholder="" id="taskUrl" name="taskUrl"  datatype="*2-200" nullmsg="赞助商任务URL不能为空">
			</div>
			<div class="col-4"> </div>
		</div>
		<div class="row cl">
			<div class="col-9 col-offset-3">
				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;保存&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</div>
<script type="text/javascript">
$(function(){
	$("#form-sydDic-add").Validform({
		ajaxPost:true,
		callback:function(data){
			$.Hidemsg()
			if(data.resultCode==200){
				layer.msg('保存成功!', {
						icon : 1,
						time : 1000
					});
				parent.location.replace("${basePath}/sysCom/comInterfaceList.do");
				layer_close();
			}else{
				$("#form-sydDic-add").resetForm();
				layer.msg('保存失败，请你检查数据!', {
					icon : 1,
					time : 1000
				});
			}
		}
	});
	
});

function popValue(id){
	$.ajax({
		url:'${basePath}/sponsorInfo/queryById.do?id='+id,
		dataType:'json',
		success:function(data){
				if(data.status=="success"){
					var sponsorInfo = data.sponsorInfo;
					$("#sponsorName").val(sponsorInfo.salesManName);
					$("#sponsorCode").val(sponsorInfo.sponsorCode);
					$("#token").val(sponsorInfo.sponsorGuid);
				}else{
					alert("获取赞助商信息失败！");
				}

			}
		});
}
</script>
</body>
</html>